import Vue from 'vue'
import Vuex from 'vuex'
import cart from './cart'
import user from './user'
import createPersistedState from 'vuex-persistedstate'
Vue.use(Vuex)

export default new Vuex.Store({
  modules: {
    cart,
    user
  },
  plugins: [createPersistedState()] // 缓存 vuex
})
